# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Poly.V1.Model.Asset do
  @moduledoc """
  Represents and describes an asset in the Poly library. An asset is a 3D model or scene created using [Tilt Brush](//www.tiltbrush.com), [Blocks](//vr.google.com/blocks/), or any 3D program that produces a file that can be upload to Poly.

  ## Attributes

  *   `authorName` (*type:* `String.t`, *default:* `nil`) - The author's publicly visible name. Use this name when giving credit to the author. For more information, see [Licensing](/poly/discover/licensing).
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - For published assets, the time when the asset was published. For unpublished assets, the time when the asset was created.
  *   `description` (*type:* `String.t`, *default:* `nil`) - The human-readable description, set by the asset's author.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The human-readable name, set by the asset's author.
  *   `formats` (*type:* `list(GoogleApi.Poly.V1.Model.Format.t)`, *default:* `nil`) - A list of Formats where each format describes one representation of the asset.
  *   `isCurated` (*type:* `boolean()`, *default:* `nil`) - Whether this asset has been curated by the Poly team.
  *   `license` (*type:* `String.t`, *default:* `nil`) - The license under which the author has made the asset available for use, if any.
  *   `metadata` (*type:* `String.t`, *default:* `nil`) - Application-defined opaque metadata for this asset. This field is only returned when querying for the signed-in user's own assets, not for public assets. This string is limited to 1K chars. It is up to the creator of the asset to define the format for this string (for example, JSON).
  *   `name` (*type:* `String.t`, *default:* `nil`) - The unique identifier for the asset in the form: `assets/{ASSET_ID}`.
  *   `presentationParams` (*type:* `GoogleApi.Poly.V1.Model.PresentationParams.t`, *default:* `nil`) - Hints for displaying the asset. Note that these parameters are not immutable; the author of an asset may change them post-publication.
  *   `remixInfo` (*type:* `GoogleApi.Poly.V1.Model.RemixInfo.t`, *default:* `nil`) - The remix info for the asset.
  *   `thumbnail` (*type:* `GoogleApi.Poly.V1.Model.File.t`, *default:* `nil`) - The thumbnail image for the asset.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - The time when the asset was last modified. For published assets, whose contents are immutable, the update time changes only when metadata properties, such as visibility, are updated.
  *   `visibility` (*type:* `String.t`, *default:* `nil`) - The visibility of the asset and who can access it.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :authorName => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :displayName => String.t() | nil,
          :formats => list(GoogleApi.Poly.V1.Model.Format.t()) | nil,
          :isCurated => boolean() | nil,
          :license => String.t() | nil,
          :metadata => String.t() | nil,
          :name => String.t() | nil,
          :presentationParams => GoogleApi.Poly.V1.Model.PresentationParams.t() | nil,
          :remixInfo => GoogleApi.Poly.V1.Model.RemixInfo.t() | nil,
          :thumbnail => GoogleApi.Poly.V1.Model.File.t() | nil,
          :updateTime => DateTime.t() | nil,
          :visibility => String.t() | nil
        }

  field(:authorName)
  field(:createTime, as: DateTime)
  field(:description)
  field(:displayName)
  field(:formats, as: GoogleApi.Poly.V1.Model.Format, type: :list)
  field(:isCurated)
  field(:license)
  field(:metadata)
  field(:name)
  field(:presentationParams, as: GoogleApi.Poly.V1.Model.PresentationParams)
  field(:remixInfo, as: GoogleApi.Poly.V1.Model.RemixInfo)
  field(:thumbnail, as: GoogleApi.Poly.V1.Model.File)
  field(:updateTime, as: DateTime)
  field(:visibility)
end

defimpl Poison.Decoder, for: GoogleApi.Poly.V1.Model.Asset do
  def decode(value, options) do
    GoogleApi.Poly.V1.Model.Asset.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Poly.V1.Model.Asset do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
